<template>
    <div class="report-pic-change-wrap">
        <el-tabs type="border-card">
            <el-tab-pane label="作业前">
                <pic-list :changeType="0" :parames="parames" :setPic="changePrePic"></pic-list>
            </el-tab-pane>
            <el-tab-pane label="作业后">
                <pic-list :changeType="1" :parames="parames" :setPic="changePostPic"></pic-list>
            </el-tab-pane>
        </el-tabs>
        <el-row class="verifyidentity-button">
            <el-button @click.stop="closeFun" round>取消</el-button>
            <el-button type="primary" @click="savePic" round>确定</el-button>
        </el-row>
    </div>
</template>
<script>
import PicList from './PicList'

export default {
    name: 'ReportPicChange',
    props: ['parames', 'setPrePic', 'setPostPic', 'closeFun'],
    components: {
        PicList
    },
    data() {
        return {
            selectPrePic: this.$route.params.preWorkPicUrl,
            selectPostPic: this.$route.params.postWorkPicUrl
        }
    },
    methods: {
        // 改变了作业前图片选择
        changePrePic(picUrl) {
            this.selectPrePic = picUrl
        },
        // 改变了作业后图片选择
        changePostPic(picUrl) {
            this.selectPostPic = picUrl
        },
        // 取消
        close() {
            this.closeFun()
        },
        // 确定
        savePic() {
            this.setPrePic(this.selectPrePic)
            this.setPostPic(this.selectPostPic)
            this.closeFun()
        }
    }
}
</script>
<style lang="scss">
.report-pic-change-wrap {
    
}
</style>